home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Small Eiffel 0.4.8 / misc / basic_test next >
Text File  |  1997-04-13  |  5KB  |  207 lines

  1. #!/bin/csh -f
  2. # Some Basic Tests including Kernel Classes
  3. #
  4. # Usage : basic_test [args_for_compile]
  5. #
  6. #set verbose = 1
  7. if (!($?SmallEiffel)) then
  8.     echo "Environment Variable 'SmallEiffel' not set."
  9.     exit 1
  10. endif
  11. set compile=${SmallEiffel}/bin/compile
  12. set clean=${SmallEiffel}/bin/clean
  13. echo Testing ${compile} $* > /dev/tty
  14. echo Options : $*
  15. ###################################################################
  16. ${clean} HELLO_WORLD >& /dev/null
  17. ${compile} $* HELLO_WORLD > /dev/null
  18. ./a.out
  19. /bin/rm -f ./a.out
  20. ###################################################################
  21. cd ${SmallEiffel}/lib_test
  22. echo -n "Testing ."
  23. foreach t (vide.e test_*.e)
  24. #    echo $t
  25.         ${clean} $t >& /dev/null
  26.     ${compile} $* $t > /dev/null
  27.     if (${status}) then
  28.         echo Error While Compiling ${t}
  29.     else
  30.         echo -n "."
  31.     endif
  32.     if (!(-x ./a.out)) then
  33.         echo No a.out for file ${t}
  34.     else
  35.         echo -n "."
  36.     endif
  37.     ./a.out
  38.     if (${status}) then
  39.         echo Error While Running ${t}
  40.     else
  41.         echo -n "."
  42.         /bin/rm -f ./a.out
  43.     endif
  44. end
  45. cd ${SmallEiffel}/bin
  46. ###################################################################
  47. ${clean} BOOST_IS_STATIC >& /dev/null
  48. ${compile} -boost BOOST_IS_STATIC > /dev/null
  49. echo -n "."
  50. ./a.out
  51. /bin/rm -f ./a.out
  52. echo -n "."
  53. ###################################################################
  54. cd ${SmallEiffel}/lib_test
  55. foreach act (all_check_test*.e)
  56.     ${compile} -all_check $act > /dev/null
  57.     ${clean} $act >& /dev/null
  58.     echo -n "."
  59.     ./a.out
  60.     /bin/rm -f ./a.out
  61. end
  62. echo -n "."
  63. cd ${SmallEiffel}/bin
  64. ###################################################################
  65. ${clean} testargs >& /dev/null
  66. ${compile} $* -o testargs TESTARGS > /dev/null
  67. testargs
  68. echo -n "."
  69. testargs 1
  70. echo -n "."
  71. testargs 2 arg2
  72. echo "."
  73. /bin/rm -f testargs
  74. ###################################################################
  75. echo "TRY_ANIMAL"
  76. ${clean} TRY_ANIMAL >& /dev/null
  77. ${compile} $* TRY_ANIMAL > /dev/null
  78. ./a.out
  79. /bin/rm -f ./a.out
  80. ###################################################################
  81. echo "TRY_PRINT_ON"
  82. ${clean} TRY_PRINT_ON >& /dev/null
  83. ${compile} $* TRY_PRINT_ON > /dev/null
  84. ./a.out
  85. /bin/rm -f ./a.out
  86. ###################################################################
  87. echo "Compiling SmallEiffel/lib_show"
  88. cd ${SmallEiffel}/bin
  89. ${clean} PYRAMID >& /dev/null
  90. ${compile} $* PYRAMID > /dev/null
  91. echo -n "."
  92. ${clean} PYRAMID2 >& /dev/null
  93. ${compile} $* PYRAMID2 > /dev/null
  94. echo -n "."
  95. ${clean} SPREAD_ILLNESS >& /dev/null
  96. ${compile} $* SPREAD_ILLNESS > /dev/null
  97. echo -n "."
  98. /bin/rm -f ./a.out
  99. ################################
  100. ${clean} FIBONACCI >& /dev/null
  101. ${compile} $* FIBONACCI > /dev/null
  102. set x = `a.out 4`
  103. if ($x == 5) then
  104.     echo -n "."
  105. else
  106.         echo error while running lib_show/fibonacci
  107. endif
  108. echo -n "."
  109. /bin/rm -f ./a.out
  110. ################################
  111. cd ${SmallEiffel}/lib_show/parking
  112. ${clean} RUN_PARKING >& /dev/null
  113. ${compile} $* RUN_PARKING > /dev/null
  114. /bin/rm -f ./a.out
  115. echo -n "."
  116. ################################
  117. cd ${SmallEiffel}/lib_show/gcd
  118. ${clean} TEST_GCD >& /dev/null
  119. ${compile} $* TEST_GCD > /dev/null
  120. echo -n "."
  121. ./a.out
  122. /bin/rm -f ./a.out
  123. echo -n "."
  124. ###################################################################
  125. cd ${SmallEiffel}/lib_show/external
  126. ${clean} EXTERNAL_DEMO >& /dev/null
  127. ${compile} $* EXTERNAL_DEMO src.c > /dev/null
  128. ./a.out >! output2
  129. if ($status) then
  130.    echo "Error in lib_show/external."
  131.    exit 1
  132. endif
  133. diff output2 output
  134. if ($status) then
  135.    echo "Error while running lib_show/external/external_demo"
  136.    exit 1
  137. endif
  138. /bin/rm -f output2 src.o ./a.out
  139. echo -n "."
  140. ###################################################################
  141. cd ${SmallEiffel}/lib_show/cecil
  142. foreach d (example*)
  143.     cd ${SmallEiffel}/lib_show/cecil
  144.     cd ${d}
  145.     ${clean} EXAMPLE >& /dev/null
  146.     /bin/rm -f a.out eiffel.h tmp
  147.     ${compile} $* EXAMPLE -cecil cecil.se c_prog.c > /dev/null
  148.     ./a.out >! tmp
  149.     if ($status) then
  150.        echo "Error in lib_show/cecil/${d}"
  151.        exit 1
  152.     endif
  153.     diff tmp output
  154.     if ($status) then
  155.        echo "Error while running lib_show/cecil/${d}"
  156.        exit 1
  157.     endif
  158.     ${clean} EXAMPLE >& /dev/null
  159.     /bin/rm -f a.out eiffel.h tmp
  160.     echo -n "."
  161. end
  162. echo -n "."
  163. ###################################################################
  164. cd ${SmallEiffel}/lib_show
  165. foreach d (bench*)
  166. cd ${SmallEiffel}/lib_show
  167. cd ${d}
  168. foreach b (*_bench.e)
  169.     /bin/rm -f a.out
  170.     ${clean} ${b} >& /dev/null
  171.     ${compile} $* ${b} > /dev/null
  172.     if ($status) then
  173.        echo "Error while compiling lib_show/${d}/${b}"
  174.        exit 1
  175.     endif
  176.     echo -n "."
  177.     ./a.out
  178.     if ($status) then
  179.        echo "Error while running lib_show/${d}/${b}"
  180.        exit 1
  181.     endif
  182.     echo -n "."
  183.     ${clean} $b >& /dev/null
  184.     /bin/rm -f a.out
  185. end
  186. end
  187. ################################
  188. cd ${SmallEiffel}/lib_rand
  189. foreach d (demo*.e)
  190.     /bin/rm -f a.out
  191.     ${clean} $d >& /dev/null
  192.     ${compile} $* $d > /dev/null
  193.     if ($status) then
  194.        echo "Error in lib_rand/${d}"
  195.        exit 1
  196.     endif
  197.     if (!(-x ./a.out)) then
  198.        echo No a.out for ${SmallEiffel}/lib_rand/${d}
  199.     else
  200.        echo -n "."
  201.     endif
  202. end
  203. /bin/rm -f a.out
  204. echo -n "."
  205. echo " Done."
  206.  
  207.